#include <linux/seq_file.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/arch/regs-gpio.h>
#include <asm/hardware.h>
#include <linux/proc_fs.h>

struct proc_dir_entry *link_status_file;

static int port_status_read(struct seq_file *file, void *v)
{
	seq_printf(file, "Driver:	%s\n", "openwrt");
	seq_printf(file, "Auther:	%s\n", "viviq");
	seq_printf(file, "Version:	%s\n", "v1.0c");
	seq_printf(file, "time:		%s\n", "2001");
	return 0; 
}

static int porc_open(struct inode *inode, struct file *file)
{
	return(single_open(file, port_status_read, NULL));
}

static struct file_operations proc_file_ops = {
 	.owner	= THIS_MODULE,
 	.open	= porc_open,
 	.read	= seq_read,
 	.llseek	= seq_lseek,
 	.release= single_release,  
};


static int proc_file_init(void)
{
	link_status_file = create_proc_entry("my_porcfile", S_IRUGO, NULL);
	if(link_status_file)
		link_status_file->proc_fops = &proc_file_ops;
	return 0;
}

static void proc_file_exit(void)
{
	if(link_status_file)
		remove_proc_entry( "my_porcfile", NULL);
}

module_init(proc_file_init);
module_exit(proc_file_exit);
MODULE_LICENSE("GPL");

